import cv2
import matplotlib.pyplot as plt
image = cv2.imread('7.jpg')
cv2.imshow('Input',image)
gray = cv2.cvtColor(image,cv2.COLOR_BGR2BGARY)
eqHist = cv2.eqalizeHist(gray)
cv2.imshow('equalizeHist',eqHist)
plt.figure(figsize = (10,10))
hist1 = cv2.calcHist([image],[0],None,[256],[0,256])
plt.subplot(121)
plt.title('Input')
plt.plot(hist1)
hist1 = cv2.calcHist([image],[0],None,[256],[0,256])
plt.subplot(122)
plt.title('equalizeHist')
plt.plot(hist2)
plt.show()
cv2.waitKey()
cv2.destroyAllWindows()